/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package brincadeira_das_tentativas_2838;

import java.util.Scanner;

/**
 *
 * @author Jairo Sousa
 */
public class tenta {

    static int[] ordena(int n, int[] vet) {

        for (int i = 0; i < vet.length; i++) {
            int troca;
            for (int j = (i + 1); j < vet.length; j++) {
                if (vet[i] > vet[j]) {
                    troca = vet[i];
                    vet[i] = vet[j];
                    vet[j] = troca;
                }
            }
        }
        return vet;
    }

    static int fatorial(int n) {
        if (n == 1) {
            return 1;
        } else {
            return (n * fatorial(n - 1));
        }
    }

    static void permutacao(int vet[], int n) {
        
        for (int i = 0; i < vet.length; i++) {
            System.out.print(vet[i]+" ");
        }
    }

    public static void main(String[] args) {
        Scanner s = new Scanner(System.in);
        int n;

        n = s.nextInt();
        int[] vetor = new int[n];

        for (int i = 0; i < vetor.length; i++) {
            vetor[i] = s.nextInt();
        }
        //Ordenando vetor.
        vetor = ordena(n, vetor);

        System.out.println("Imprimindo o Vetor");
        System.out.print(n + " ");
        for (int i = 0; i < vetor.length; i++) {
            System.out.print(vetor[i] + " ");

        }
        

    }
}
